using UnityEngine;
using UnityEngine.InputSystem;

public class Lesson2_Exercises : MonoBehaviour
{
    Keyboard keyboard;
    public Transform cube;
    float scale = 1;
    void Start()
    {
        keyboard = Keyboard.current;
    }

    void Update()
    {
        //+
        if (keyboard.numpadPlusKey.wasPressedThisFrame || keyboard.equalsKey.wasPressedThisFrame)
        {
            scale++;
            cube.localScale = Vector3.one * scale;
            Debug.LogFormat("+ scale:{0}", scale);
        }
        //-
        if (keyboard.numpadMinusKey.wasPressedThisFrame || keyboard.minusKey.wasPressedThisFrame)
        {
            scale--;
            if (scale < 1)
                scale = 1;
            cube.localScale = Vector3.one * scale;
            Debug.LogFormat("- scale:{0}", scale);
        }
    }
}
